<template>
    <div>

        <van-field readonly required name="businessId" :value="fromdata.businessId" label="商机编号:" label-width="5em" />
        <van-field readonly required name="businessName" :value="fromdata.businessName" label="商机项目名称:"
            label-width="7em" autosize type="textarea" rows="1"/>
        <van-field readonly required name="customerCode" :value="fromdata.customerCode" label="集团客户编码:"
            label-width="7em" />
        <van-field readonly required name="customerName" :value="fromdata.customerName" label="集团客户名称:"
            label-width="7em" autosize type="textarea" rows="1"/>
        <van-field readonly name="industryBigTypeProvince" :value="fromdata.industryBigTypeProvince" label="省内行业大类：" label-width="7em" />
        <van-field readonly name="industryBigTypeGroup" :value="fromdata.industryBigTypeGroup" label="集团行业大类：" label-width="7em" />
        <van-field readonly name="industryMinTypeGroup" :value="fromdata.industryMinTypeGroup" label="集团行业小类：" label-width="7em" />
        <van-field readonly name="industryAttribution" :value="fromdata.industryAttribution" label="15大行业名称：" label-width="7.5em" />
        <van-field readonly name="industryNameOneLevel" :value="fromdata.industryNameOneLevel" label="行业一级名称：" label-width="7em" />
        <van-field readonly name="industryNameTwoLevel" :value="fromdata.industryNameTwoLevel" label="行业二级名称：" label-width="7em" />
        <van-field readonly required name="city" :value="fromdata.city" label="地市:" label-width="3em" />
        <van-field readonly required name="counties" :value="fromdata.counties" label="县区:" label-width="3em" />
        <van-field readonly required autosize type="textarea" rows="1" name="buildContent"
            :value="fromdata.buildContent" label="项目建设内容:" label-width="7em" />
        <van-field readonly required name="buildProjectNumber" :value="fromdata.buildProjectNumber" label="立项项目编码:"
            label-width="7em" />
        <van-field readonly required name="buildProjectName" :value="fromdata.buildProjectName" label="立项项目名称:"
            label-width="7em" />
        <van-field readonly required name="projectModel" :value="fromdata.projectModel" label="项目实施类型:"
            label-width="6.5em" />
        <van-field readonly required name="decisionStartDate" :value="fromdata.decisionStartDate" label="立项开始时间:"
            label-width="6.5em" />
        <van-field readonly required name="buildType" :value="fromdata.buildType" label="立项类型:" label-width="5em" />
        <van-field readonly required name="initDecisionCompleteDate" :value="fromdata.initDecisionCompleteDate"
                 label="预决策完成(通过)时间:" label-width="11.5em" />
        <van-field readonly required name="decisionCompleteDate" :value="fromdata.decisionCompleteDate"
            label="立项完成（通过）时间:" label-width="11em" />
        <van-field readonly required name="isRenew" :value="fromdata.isRenew" label="是否续签项目:" label-width="7em" />
        <van-field readonly required name="isBidProject"
            :value="fromdata.isBidProject ? '是' : (fromdata.isBidProject == null ?'是':'否')" label="是否招投项目:"
            label-width="7em" />
        <van-field readonly required name="isSignContract" :value="fromdata.isSignContract ? '是' : '否'"
            label="是否已签定收入合同:" label-width="10em" />
        <el-table v-if="fromdata.isSignContract" :data="fromdata.contractList"
            :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }" border
            style="width: 100%">
            <el-table-column prop="contractNumber" label="合同编号" width="110" />
            <el-table-column prop="contractName" label="合同名称" width="200" />
            <el-table-column prop="contractSignTime" label="合同签订时间" width="110" />
            <el-table-column prop="contractConfessTime" label="合同要求交底时间" width="110" />
            <el-table-column prop="projectPattern" label="合同项目模式" width="120" />
        </el-table>
        <van-field readonly required name="autonomousImplemention" :value="fromdata.autonomousImplemention"
            label="是否自主实施:" label-width="7em" />
        <van-field readonly required name="autonomousImplementionType"
            :value="fromdata.autonomousImplementionType" label="项目自主实施类型:" label-width="9em" />
        <van-field v-if="fromdata.autonomousImplemention == '是'" readonly required name="autImplementScope"
            :value="fromdata.autImplementScope" label="自主实施范围:" label-width="7em" />
        <van-field readonly name="isSpecialDebt" :value="fromdata.isSpecialDebt==1?'是':'否'" label="是否专项债：" label-width="6em" />
      <!-- 移动云解决方案 -->
      <van-field readonly required name="isCloudSolution"
                 :value="fromdata.isCloudSolution=='1' ? '是' : '否'" label="是否包含移动云解决方案:" label-width="11.5em"/>
      <van-field v-if="fromdata.isCloudSolution === '1'" readonly name="industrySceneScheme" :value="fromdata.industrySceneScheme" label="涉及重点行业场景解决方案:"
                 label-width="12.5em"/>
        <!-- 成本 -->
        <div v-if="buildTypeIsCB">
          <van-field readonly name="preTotalProfit" :value="fromdata.preTotalProfit" label="预立项项目整体利润率(%):" label-width="12.25em" />
          <van-field readonly name="preNpvR" :value="fromdata.preNpvR" label="预立项净现值率(%):" label-width="9.25em" />
          <van-field readonly name="preIrr" :value="fromdata.preIrr" label="预立项内部收益率(%):" label-width="10.25em" />
          <van-field readonly name="preItProfit" :value="fromdata.preItProfit" label="预立项IT部分利润率(%):" label-width="11.25em" />
          <van-field readonly name="preWholeGrossProfit" :value="fromdata.preWholeGrossProfit" label="预立项项目通服毛利率(%):" label-width="12.25em" />
          <van-field readonly name="preComplexItPrm" :value="fromdata.preComplexItPrm" label="预立项项目IT通服毛利率(%):" label-width="13.25em" />
          <van-field readonly name="decisionMargin" :value="fromdata.decisionMargin"  label="正式立项项目整体利润率(%):" label-width="13.25em" />
          <van-field readonly name="npvR" :value="fromdata.npvR" label="正式立项净现值率(%):" label-width="10.25em" />
          <van-field readonly name="irr" :value="fromdata.irr" label="正式立项内部收益率(%):" label-width="11.25em" />
          <van-field readonly name="itProfit" :value="fromdata.itProfit" label="正式立项IT部分利润率(%):" label-width="12.25em" />
          <van-field readonly name="wholeGrossProfit" :value="fromdata.wholeGrossProfit" label="正式立项通服毛利率(%):" label-width="11.25em" />
          <van-field readonly name="complexItPrm" :value="fromdata.complexItPrm" label="正式立项IT通服毛利率(%):" label-width="12.25em" />
          <van-field readonly name="marginDeviation" :value="fromdata.marginDeviation" label="整体利润率偏差(%):" label-width="9.25em" />
          <van-field readonly name="npvDeviation" :value="fromdata.npvDeviation" label="净现值率偏差(%):" label-width="8.25em" />
          <van-field readonly name="irrDeviation" :value="fromdata.irrDeviation" label="内部收益率偏差(%):" label-width="9.25em" />
          <van-field readonly name="preItProfitDeviation" :value="fromdata.preItProfitDeviation" label="IT部分利润率偏差(%):" label-width="10.25em" />
          <van-field readonly name="complexPrmDeviation" :value="fromdata.complexPrmDeviation" label="通服毛利率偏差(%):" label-width="9.25em" />
          <van-field readonly name="complexItPrmDeviation" :value="fromdata.complexItPrmDeviation" label="IT通服毛利率偏差(%):" label-width="10.25em" />
          <!--            <van-field readonly name="bidGrossMargin" :value="fromdata.bidGrossMargin" label="标前决策毛利率(%):"-->
          <!--                label-width="10.25em" />-->
          <!--            <van-field readonly required name="decisionMargin" :value="fromdata.decisionMargin" label="立项不含税毛利率(%):"-->
          <!--                label-width="11.25em" />-->
            <van-field readonly name="isProjectChange" :value="fromdata.isProjectChange ? '是' : '否'" label="是否需要进行项目变更:"
                label-width="11em" />

            <van-field readonly required label="立项决策材料:" label-width="7em" />
            <div v-for="(fileitem) in fromdata.decisionMaterials" :key="fileitem.id" style="margin-left:20px">
                <div readonly class="font14 fileLink" style="color:#0F85CF">
                    <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
                </div>
            </div>
            <div v-if="aiDataResult&&aiDataResult.resultData">
              <ai-el-table :aiDataResult="aiDataResult"></ai-el-table>
            </div>
            <van-field v-if="fromdata.isProjectChange" readonly required label="变更决策材料:" label-width="7em" />
            <div v-for="(fileitem) in fromdata.changeDecisionMaterials" :key="fileitem.id" style="margin-left:20px">
                <div readonly v-if="fromdata.isProjectChange" class="font14 fileLink" style="color:#0F85CF">
                    <a target="_blank" @click="openFileUrlfun(fileitem.anonymousFilePath)">{{ fileitem.fileName }}</a>
                </div>
            </div>

            <van-field readonly name="projectCompleteTime" :value="fromdata.projectCompleteTime" label="成本类项目立项要求完成时间:"
                label-width="14em" />
        </div>
        <van-field readonly required name="autonomousImplemention" :value="fromdata.autonomousImplemention"
                   label="是否自主实施:" label-width="7em" />
        <van-field readonly required name="autonomousImplementionType"
                   :value="fromdata.autonomousImplementionType" label="项目自主实施类型:" label-width="9em" />
        <van-field v-if="fromdata.autonomousImplemention == '是'" readonly required name="autImplementScope"
                   :value="fromdata.autImplementScope" label="自主实施范围:" label-width="7em" />
        <van-field readonly name="isSpecialDebt" :value="fromdata.isSpecialDebt==1?'是':'否'" label="是否专项债：" label-width="6em" />
        <van-field v-if="fromdata.isSpecialDebt==1" readonly required name="isApplyDebt" :value="fromdata.isApplyDebt=='Y'?'是':fromdata.isApplyDebt=='N'?'否':''" label="中国移动是否参与申债:" label-width="10.5em" />
        <van-field v-if="fromdata.isSpecialDebt==1" readonly required name="supportEnterprise5" :value="fromdata.supportEnterprise5" label="商机/项目支撑单位:" label-width="10em" />
        <van-field v-if="fromdata.isSpecialDebt==1" readonly required name="segmentedScenes" :value="fromdata.segmentedScenes" label="项目所属细分场景:" label-width="8.5em" />
        <van-field v-if="fromdata.isSpecialDebt==1" readonly required name="areaLevel" :value="fromdata.areaLevel" label="项目区划级别:" label-width="6.5em" />
        <!-- 当前办理人 -->
        <section-header v-if="showHistory" :sectionTitle="'当前办理人:'" />
        <div v-if="showHistory" class="font13 ptandpb10 pl16">
            <div>
                <span class="titletext font13">{{
                    historydata.MANAGER
                    }}</span>
            </div>
            <div class="mt5">
                <span class="graytext font12">{{ historydata.DEPARTMENT }}</span>
            </div>
        </div>


        <!-- 审批意见 -->
        <section-header id="opinion" :sectionTitle="'审批意见:'" />
        <opinion-item :approveList="approveList" />

    </div>
</template>
 
<script>

import {getDictList, req} from "@/api/dictapi";
import { openFileUrl } from '@/store/openFile'
import OpinionItem from '../sztdzj/sztdzjDetail/opinion-item.vue';
import SectionHeader from '../sztdzj/sztdzjDetail/section-header.vue';
import {Notify, Toast} from "vant";
import { mapGetters } from "vuex";
import aiElTable from "@/components/aiElTable/index.vue";
import util from "@/assets/js/public";

export default {
    data() {
        return {

            hasDSCB: false,
            hasSGSCB: false,
            canEditDSCB: false,
            canEditSGSCB: false,


            showDescriptionFileList: false,
            showUndertakeFileList: false,
            showCostFileList: false,
            showMeetingFileList: false,
            showChangeDescriptionFileList: false,
        }
    },

    props: ['fromdata', 'showHistory', 'historydata', 'approveList', 'location','aiDataResult'],
    computed: {
        ...mapGetters(["user"]),
        ...mapGetters(["userinfo"]),
        buildTypeIsCB() {
            return this.fromdata.buildType == '成本';
        },

    },

    methods: {



        /// 投标主体
        bidderMainFun() {

        },



        tomsg() {
            document.getElementById('opinion').scrollIntoView({ behavior: 'smooth' })
        },

        openFileUrlfun(value) {
            this.$router.push(
                {
                    name: 'fileview',
                    query: {
                        openFileUrl: openFileUrl(value)
                    }
                }
            );
        },
    },
    //生命周期--挂载完成
    components: {
        aiElTable,
        OpinionItem,
        SectionHeader
    },

}
</script>
 
<style lang="scss" scoped></style>